#include <iostream>
using namespace std;
int arr[1005][1005];
int main() {
    int m, n;

    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        for (int j = x1 - 1; j < x2; j++) {
            for (int h = y1 - 1; h < y2; h++) {
                arr[j][h] += 1;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cout << arr[i][j] << " ";
        }
        cout << endl;
    }
}
